Skip to content

Conversation

Frando
Copy link
Member

@Frando Frando commented Sep 30, 2025

Description

The recently released redb v3 has incompatible changes to the database format. The recommended upgrade procedure is to upgrade the database with Database::upgrade on redb v2.6+. The upgrade has to be done on redb v2, not v3. See https://github.com/cberner/redb/blob/master/CHANGELOG.md#removes-support-for-file-format-v2.

This updates redb to 2.6 and performs the upgrade when opening the database. Calling upgrade on an already upgraded database is a no-op.

With this merged in the next release, we can then update redb to v3 in the version after.

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@Frando Frando requested a review from rklaehn September 30, 2025 07:24
Copy link
Collaborator

@rklaehn rklaehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems fine. Have you tried it out with a real db?

Given that blobs 9.x is still marked as non production ready I think we should definitely do this, but doing one quick manual test would be good.

@Frando
Copy link
Member Author

Frando commented Sep 30, 2025

Yes, I tried with the random_store example. Ran on main with a path set, then changed to this branch, and reran with same path. Got the info log about the upgrade, and things worked seamlessly.

irpc = { version = "0.8.0", features = ["rpc", "quinn_endpoint_setup", "spans", "stream", "derive"], default-features = false }
iroh-metrics = { version = "0.35" }
redb = { version = "=2.4", optional = true }
redb = { version = "2.6.3", optional = true }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this version 2.x and later we call it v3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From redb 2.6 Database::upgrade exists and changes the database format into a forward-compatible format that works both with redb v2.6+ and redb v3. The upgrade code is only part of redb v2, it was removed in v3, which only works with the upgraded format. So we have to do the upgrade with redb v2.6, and can then upgrade to v3 in the next release after the next.

Copy link

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/174/docs/iroh_blobs/

Last updated: 2025-09-30T07:37:47Z

@n0bot n0bot bot added this to iroh Sep 30, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Sep 30, 2025
@Frando Frando merged commit 4645452 into main Oct 1, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants